Dynamic Pain Assessment and Management System